//导入request.js请求工具
import request from '@/utils/request.js'

//提供调用注册接口的函数
export const userRegisterService = (registerData)=>{
    return request.post('/admin/admin/register',registerData);
}

//提供调用登录接口的函数
export const userLoginService = (loginData)=>{
    return request.post('/admin/admin/login',loginData)
}


//获取用户详细信息
export const userInfoService = ()=>{
    return request.get('/admin/admin')
}

//修改个人信息
export const userInfoUpdateService = (userInfoData)=>{
   return request.put('/admin/admin',userInfoData)
}

//修改密码
export const userPasswordUpdateService = (updatePasswordData)=>{
    return request.put('/admin/admin/password',updatePasswordData)
}

//修改头像
export const userAvatarUpdateService = (avatarUrl)=>{
    const params = new URLSearchParams();
    params.append('avatarUrl',avatarUrl)
    return request.patch('/admin/updateAvatar',params)
}

//提供调用学生用户分页查询接口的函数
export const adminPageQueryService = (params)=>{
    return request.get('/admin/admin/page',{params: params});
}

 //删除个人信息
 export const adminDeleteService = (id)=>{
    return request.delete('/admin/admin/delete/' + id)
 }

 export const adminInfoGetService = (id)=>{
    return request.get('/admin/admin')
}

  //获取个人信息
  export const adminRegisterService = (registerData)=>{
    return request.post('/admin/admin/register', registerData)
}

//修改个人信息
export const adminInfoUpdateService = (userInfoData)=>{
    return request.put('/admin/admin',userInfoData)
}